﻿using ReportGen;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace ReportTest
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            cbo.ItemsSource = this.Itesms;
            cbo.SelectedIndex = Itesms.Length - 1;
        }


        private string[] Itesms = {"test1", "test2", "test3", "xml1", "xml2" };

        private void btn_Click(object sender, RoutedEventArgs e)
        {
            DateTime dtStart = DateTime.Now;
            var selectText = cbo.Text;
            var result = "";
            if (selectText== "test2")
            {
                result= Help.test2();
            }
            else if (selectText == "test1")
            {
                result = Help.test1();
            }
            else if (selectText == "test3")
            {
                result = Help.test3();
            }
            else if (selectText == "xml1")
            {
                result = Help.xml1();
            }
            else if (selectText == "xml2")
            {
                result = Help.xml2();
            }
            else
            {

            }
            
            DateTime dtEnd = DateTime.Now;
            txt.Text = result;

            var costMsecond = dtEnd.Subtract(dtStart).TotalMilliseconds;


            lbl.Text = $"执行完成 花费时间{costMsecond}毫秒";
        }




    }
}
